import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LoglistComponent } from '../pages/log/loglist/loglist.component';
import { HomeComponent } from './home.component';
import { AddlogComponent } from '../pages/log/addlog/addlog.component';
import { LogdetailComponent } from '../pages/log/logdetail/logdetail.component';
import { UpdatelogComponent } from '../pages/log/updatelog/updatelog.component';
import { UserComponent } from '../pages/user/user/user.component';
import { PersonalComponent } from '../pages/user/personal/personal.component';
import { SystemComponent } from '../pages/system/system.component';
import { NoticeComponent } from '../pages/notice/notice.component';
import { FilerecordComponent } from '../pages/filerecord/filerecord.component';

const routes: Routes = [
  {
    path: '',
    component: HomeComponent,
    children: [
      { path: '', redirectTo: 'loglist', pathMatch: 'full' },
      { path: 'loglist', pathMatch: 'full', component: LoglistComponent },
      { path: 'addlog', pathMatch: 'full', component: AddlogComponent },
      { path: 'detailLog', pathMatch: 'full', component: LogdetailComponent },
      { path: 'updateLog', pathMatch: 'full', component: UpdatelogComponent },
      { path: 'user', pathMatch: 'full', component: UserComponent },
      { path: 'personal', pathMatch: 'full', component: PersonalComponent },
      { path: 'system', pathMatch: 'full', component: SystemComponent },
      { path: 'notice', pathMatch: 'full', component: NoticeComponent },
      { path: 'filerecord', pathMatch: 'full', component: FilerecordComponent },
    ],
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class HomeRoutingModule {}
